// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{af38598e-d49e-42a5-9d86-7311fb60c264}")]
	#endregion

	#endregion
	public class Begegnung: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 7);
			public const int Ausgetragen_MemberIndex = Eco_FirstMember + 0;
			public const int AuswaertsSpieler_MemberIndex = Eco_FirstMember + 1;
			public const int BegegnungsErgebnis_MemberIndex = Eco_FirstMember + 2;
			public const int BegegnungsSaetze_MemberIndex = Eco_FirstMember + 3;
			public const int Gewertet_MemberIndex = Eco_FirstMember + 4;
			public const int HeimSpieler_MemberIndex = Eco_FirstMember + 5;
			public const int Spiel_MemberIndex = Eco_FirstMember + 6;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Begegnung.Eco_LoopbackIndices.Ausgetragen_MemberIndex), Id="{295ef3ae-afc9-40ab-8d32-f946203c3148}")]
		[UmlMetaAttribute("initialValue", "true")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Wurde das Spiel wirklich ausgetragen
		/// Wurde das Spiel wirklich ausgetragen
		#endregion

		#endregion
		public bool Ausgetragen
		{
			get
			{
				#region MM_ECO_Generated
				return (bool) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Ausgetragen_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Ausgetragen_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Begegnung.Eco_LoopbackIndices.BegegnungsErgebnis_MemberIndex), Id="{c1653b1f-777a-4a03-98fa-2a83522890b0}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.BegegnungErgebnis), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Ergebnis BegegnungsErgebnis
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Ergebnis) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.BegegnungsErgebnis_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.BegegnungsErgebnis_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Begegnung.Eco_LoopbackIndices.BegegnungsSaetze_MemberIndex), Id="{4b6556e1-653f-4100-8f40-c53345a7b24b}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.BegegnungsSaetze), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		[UmlTaggedValue("Eco.Ordered", "True")]
		#endregion
		public IEcoList<Ergebnis> BegegnungsSaetze
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Ergebnis>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.BegegnungsSaetze_MemberIndex)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Begegnung.Eco_LoopbackIndices.Gewertet_MemberIndex), Id="{abb4bd7c-d5fd-4f41-bb3a-45f30c352ae6}")]
		[UmlMetaAttribute("initialValue", "true")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Wurde das Spiel wirklich gewertet
		/// Wurde das Spiel wirklich gewertet
		#endregion

		#endregion
		public bool Gewertet
		{
			get
			{
				#region MM_ECO_Generated
				return (bool) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Gewertet_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Gewertet_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Begegnung.Eco_LoopbackIndices.Spiel_MemberIndex), Id="{69132eff-a1f5-45f6-8754-b2d24e986792}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SpielBegegnung), Index=0)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.Spiel Spiel
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.Spiel) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spiel_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spiel_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Begegnung.Eco_LoopbackIndices.AuswaertsSpieler_MemberIndex), Id="{67f226be-5e56-43e1-83ad-ac7f4ec0dc72}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.BegegnungAufgestellerSpieler1), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.AufgestellerSpieler AuswaertsSpieler
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.AufgestellerSpieler) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.AuswaertsSpieler_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.AuswaertsSpieler_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Begegnung.Eco_LoopbackIndices.HeimSpieler_MemberIndex), Id="{4d2974c1-b4db-4fd5-802d-7a382b75b8a9}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.BegegnungAufgestellerSpieler), Index=1)]
		[UmlMetaAttribute("multiplicity", "1")]
		[UmlTaggedValue("Eco.Embed", "True")]
		#endregion
		public TTServer.AufgestellerSpieler HeimSpieler
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.AufgestellerSpieler) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.HeimSpieler_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.HeimSpieler_MemberIndex, ((object)(value)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Begegnung(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Begegnung(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
